//
//  SignInView.m
//  LoverGo
//
//  Created by YeXiao on 14-1-18.
//  Copyright (c) 2014年 yexiao. All rights reserved.
//

#import "SignInView.h"
#include "LGUtil.h"

@implementation SignInView

@synthesize delegate = _delegate;


- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = LGCOLOR_gray;
        UIImageView *nextBtn1 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 15, 15)];
        nextBtn1.image = [UIImage imageNamed:@"btn_next.png"];
        nextBtn1.center = CGPointMake(290, 20);
        UIImageView *nextBtn2 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 15, 15)];
        nextBtn2.image = [UIImage imageNamed:@"btn_next.png"];
        nextBtn2.center = CGPointMake(290, 20);
        UIImageView *nextBtn3 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 15, 15)];
        nextBtn3.image = [UIImage imageNamed:@"btn_next.png"];
        nextBtn3.center = CGPointMake(290, 20);

        
        
        UIView* visitLabel = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)];
        visitLabel.backgroundColor = [UIColor whiteColor];
        UILabel* lab1 = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 180, 40)];
        lab1.text = @"个人信息(访客)";
        [visitLabel addSubview:lab1];
        [self addSubview:visitLabel];
        UIButton *loginBtn =[LGUtil get9ScalBtn:CGRectMake(10,  50, 300, 44) type:TypeColorOrange];
        [loginBtn setTitle:@"登录/注册" forState:UIControlStateNormal];
        [loginBtn setTag:SignInTypeLogin];
        [loginBtn addTarget:self action:@selector(singInClieck:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:loginBtn];
        //
        UIView* sysLab =[[UIView alloc]initWithFrame:CGRectMake(0, 100, SCREEN_WIDTH, 40)];
        sysLab.backgroundColor = [UIColor whiteColor];
        UILabel* lab2 = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, 40)];
        lab2.text = @"系统消息";
        [sysLab addSubview:lab2];
        [sysLab addSubview:nextBtn1];
        [self addSubview:sysLab];
        UITapGestureRecognizer *tg1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(labelEvent:)];
        sysLab.tag = SignInTypeSys;
        [sysLab addGestureRecognizer:tg1];
        //
        UIView* helpLab =[[UIView alloc]initWithFrame:CGRectMake(0, 141, SCREEN_WIDTH, 40)];
        helpLab.backgroundColor = [UIColor whiteColor];
        UILabel* lab3 = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, 40)];
        lab3.text = @"帮助与反馈";
        [helpLab addSubview:lab3];
        [helpLab addSubview:nextBtn2];
        [self addSubview:helpLab];
        UITapGestureRecognizer *tg2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(labelEvent:)];
        helpLab.tag = SignInTypeHelp;
        [helpLab addGestureRecognizer:tg2];
        //
        UIView* aboutLab =[[UIView alloc]initWithFrame:CGRectMake(0,182, SCREEN_WIDTH, 40)];
        aboutLab.backgroundColor = [UIColor whiteColor];
        UILabel* lab4 = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 130, 40)];
        lab4.text = @"关于情侣去哪儿";
        [aboutLab addSubview:lab4];
        [aboutLab addSubview:nextBtn3];
        [self addSubview:aboutLab];
        UITapGestureRecognizer *tg3 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(labelEvent:)];
        aboutLab.tag = SignInTypeAbout;
        [aboutLab addGestureRecognizer:tg3];
        
    }
    return self;
}
-(void)labelEvent:(UITapGestureRecognizer*)t
{
    [_delegate SignInViewBtnClieck:t.view.tag];
}
-(void)singInClieck:(UIButton *)btn
{
    [_delegate SignInViewBtnClieck:btn.tag];
}

@end
